<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>-报名记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/student/student.css" rel="stylesheet">
    
	<style>
	   .tools a i{
	    color:#19a9d5
	  }
	  .tools a i:hover{
	    text-shadow:0px 0px 5px #19a9d5;
	  }
      .tools>.baohuqi>.switchery{
          height: 17px;
          width: 29px;
      }
      .tools>.baohuqi>.switchery>small{
            width: 16px;
            height: 16px;
      }
      .tools>.baohuqi{
          margin-right: 20px;
          display: inline-block;
      }

      .zyc {
             display: none;
             margin: 10px 10px;
         }
         .zyc input{
            width: 130px;
            height: 100%;
            display: inline-block;
            font-weight: bold;
            text-align: center;
            letter-spacing: 0.3em;
         }
         .zyc textarea{
            border-color: #cfdadd;
            border-radius: 2px;
         }
         .zyc img{
            display: inline-block;
            width: 100px;
            margin-top: -4px;
            border-radius: 2px;
            border: 1px #cfdadd solid;
         }
         .zyc select {
            padding: 0px 12px;
         }
         #zycsubmit{
            display: block;
            margin-top: 10px;
            border-radius: 2px;
         }
	</style>

</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>报名记录</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="{:url('Index/admin')}">主页</a>
                </li>
                <li>
                    <strong>报名记录</strong>
                </li>
            </ol>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>报名记录</h5>
                        <div class="ibox-tools tools">
							<!-- <a href="{:url('student/information')}"><i class="glyphicon glyphicon-plus" title="添加栏目"></i></a> -->
						</div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <!-- <div class="col-sm-3">
                                <form action="" method="post" style="width: 100%">
                                    <div class="input-group">
                                        <input type="text" name="key" id="searchInput" placeholder="请输入关键词" class="input-sm form-control"><span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                    </div>
                                </form>
                            </div> -->
                        </div>
                        <div class="table-responsive">
                            
                                <input type="text" class="form-control input-sm m-b-xs" id="filter"
                                       placeholder="搜索表格...">
    
                                <table class="footable table table-stripped" data-page-size="8" data-filter=#filter>
                                    <thead>
                                            <tr>
                                                <th>记录ID</th>
                                                <th>学生姓名</th>
                                                <th>咨询师</th>
                                                <th>报名费用</th>
                                                <th>课程</th>
                                                <th>发票号</th>
                                                <th>报名时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {volist name='logdata' id='vo'}
                                                <tr class="gradeU">
                                                        <td>{$vo.id}</td>
                                                        <td>{$vo.sname}</td>
                                                        <td>{$vo.username}</td>
                                                        <td>{$vo.registeryfee}</td>
                                                        <td class="center">{$vo.course}</td>
                                                        <td class="center">{$vo.receipt_number}</td>
                                                        <td class="center">
                                                            {php}echo date("y-m-d",strtotime($vo['registerytime'])){/php}
                                                        </td>
                                                </tr>
                                            {/volist}
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="5">
                                                    <ul class="pagination pull-right"></ul>
                                                </td>
                                            </tr>
                                        </tfoot>
                                </table>
                            
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
    
    <!-- 全局js -->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/static/admin/js/plugins/footable/footable.all.min.js"></script>
    <script src="/static/admin/js/content.js"></script>
    <!-- Peity -->
    <script src="/static/admin/js/plugins/peity/jquery.peity.min.js"></script>
    <!-- Switchery -->
    <!-- <script src="/static/admin/js/plugins/switchery/switchery.js"></script> -->
    <script src="/static/admin/layui/layui.js"></script>
    
    <script>
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //点击提交
            $(".del").click(function(){
                var s = $(this);
                var ids=$(this).parents(".pa").find(".sids").html();
                // alert(ids);
                var que= window.confirm("确定要删除吗");
                $.post("{:url('Student/delete')}",{id:ids},function(msg){
                         
                         if (msg==1) {
                            alert("删除成功");
                         }else{
                            alert("删除失败");
                         }
                })

            });



            var inputTips;
            $('#searchInput').focus(function(){  //获取焦点时 显示提示
                var that = $(this);
                inputTips = layer.tips('搜索框查询 联系方式/姓名/e-mail ', that, {tips: 1,time:false});
            });
            
            $('#searchInput').blur(function(){  //失去焦点时 关闭提示
                layer.close(inputTips);
            });

            $('#searchInput').keydown(function(ev){ //按下Enter键 搜索
                var ev = ev||event;
                if(ev.keyCode==13) $('#searchBtn').click();
            });
     

        });

        $('#zycsubmit').on('click',function(){ //资源池验证
            var str = $('#zyc #yzmstr').val();
            var resid = $(this).attr('data-id');
            var logtext = $('#zyc #logtext').val();
            var aims = -1;
            
            var data = {resid:resid,logtext:logtext,aims:aims};
            if(!strCheck.checkEmpty({elem:'#zyc'})) return false;
            $.ajax({
                url:"{:url('Counselors/checkyzm')}",
                type: 'post',
                data: {code:str},
                success: function(re){
                    if(re.code){
                        layer.msg(re.msg,{icon:1,time:2000,offset :'100px',});
                        sendTransfer(data); //转移资源
                    }else{
                        layer.msg(re.msg,{icon:5,time:2000,offset :'100px',});
                    }
                    // 刷新验证码
                    $('#zyc #yzmImg').attr('src','{:captcha_src()}?'+Math.random());
                    
                },
                error:function(re){
                    console.log(re.msg);
                }
            });
         });

        

         $('.transfer').on('click',function(){
            var resid = $(this).attr('data-id');
            var zxsid = $(this).attr('zxsid');
            $("#zyc select option").each(function(){
                if($(this).val()==zxsid)$(this).css('display','none');
            });
            layer.open({
                    type    : 1,
                    title   : false,
                    shade   : false,
                    offset  : '100px',
                    content : $('#zyc')
                });
            $('#zycsubmit').attr('data-id',resid);
         });

         function sendTransfer(data){  //发送更新数据
            
            $.ajax({
                url:"{:url('Counselors/transfer')}",
                type: 'post',
                data: data,
                success: function(re){
                    layer.closeAll();
                    if(re.code){
                        layer.msg(re.msg,{icon:1,offset :'100px',});
                        $('#zyc #logtext, #zyc #yzmstr').val('');//清空文本内容
                        window.location.reload();
                    }else{
                        layer.confirm(re.msg, {icon: 3, title:'转移被拒绝',offset :'100px',btn: ['去修改资源状态', '取消']}, function(index){
                            var resid = re.data.resid;
                            parent.window.location.href="{:url('Student/update')}?id="+resid;
                            
                        layer.close(index);
                        });
                    }
                    
                },
                error:function(re){
                    console.log(re.msg);
                }
            });
         }




        // //状态的切换按钮的初始化样式
        // var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
        // elems.forEach(function(html) {
        //     var switchery = new Switchery(html,{ size: 'small' });
        // });
        //修改状态
        $(".js-switch").change(function(){
            var checkedS = $(this).is(":checked");
            var ids = $(this).attr("data-id");
            var st = "";
            var str = "";
            if(checkedS){
                st = 1;
                str = "显示";
            }else{
                st = 2;
                str = "隐藏";
            }
            $.post("{:url('Menus/setStatus')}",{id:ids,status:st},function(data){

                layer.msg(str+data.msg,{time:2000});
            });
        });


        $(document).ready(function() {

            $('.footable').footable();
            $('.footable2').footable();

        });
        
        window.onload = function () {
             $('.footable-tbody-hide').css('visibility','visible')
        }
    </script>
</body>
</html>
